﻿<Window x:Class="FolderBrowser.Views.FolderBrowserDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        mc:Ignorable="d"
        x:Name="view"

        xmlns:behav="clr-namespace:FolderBrowser.Views.Behaviours"
        xmlns:views="clr-namespace:FolderBrowser.Views"

        Width="600"
        Height="600"
        WindowStyle="ToolWindow"
        ResizeMode="CanResizeWithGrip"
        Title="Browse For Folder"
        Background="#FFD3CCCC"
        behav:DialogCloser.DialogResult="{Binding DialogCloseResult}"        
        >
   
    <DockPanel  Width="Auto" Height="Auto">
        <!-- The selected folder path -->
        <StackPanel DockPanel.Dock="Bottom">
            <TextBox DataContext="{Binding TreeBrowser}"
                     Text="{Binding Path=SelectedFolder, UpdateSourceTrigger=PropertyChanged}"
                     behav:TextChangedCommand.ChangedCommand="{Binding FolderSelectedCommand}"

                     MinHeight="25"
                     Margin="5"
                     VerticalContentAlignment="Center" />
            <StackPanel Orientation="Horizontal"
                        HorizontalAlignment="Right">
                <Button Width="75"
                        Margin="10" Click="Ok_Click">Ok</Button>
                <Button Width="75"
                        Margin="10"
                        IsCancel="True">Cancel</Button>
            </StackPanel>
        </StackPanel>

    <views:BrowseDirectoriesView DataContext="{Binding TreeBrowser}" />

  </DockPanel>
</Window>